package com.science.slam.service;

import com.science.slam.domain.File;
import com.baomidou.mybatisplus.extension.service.IService;
import com.science.slam.domain.User;
import com.science.slam.request.EditFileMessageRequestBody;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;


public interface FileService extends IService<File> {
    /**
     * 进行云端上传功能
     * @param file 待传输的文件
     * @param user 当前用户
     * @return 文件的云端地址
     * @throws IOException
     */
    String uploadToCloud(MultipartFile file, User user);

    Boolean getVideoByURL(String path, HttpServletResponse response);

    Boolean checkDownloadAuthorization(String url, User user);

    Boolean checkDeleteAuthorization(String url, User user);

    Boolean checkEditAuthorization(String url, User user, String messageName);

    List<File> getAllFiles(String account);

    Boolean deleteFileByUrl(String url);

    Boolean deleteFromDatabase(String url);

    Boolean editFileMessage(String url, EditFileMessageRequestBody body);

    List<File> searchByTags(List<String> tags);

    File searchByID(String id);

    List<File> getAllPublicFiles();

    Integer incrementLookNumber(String fileID);

    Integer incrementLikeNumber(String fileID);

    Integer decrementLikeNumber(String fileID);
}
